﻿<script type="text/javascript">
    var single_table_filter = {
        data() {
            return {
                columnOpts: []
            }
        },
        methods: {
            init(slots) {
                var opts = [];
                slots.forEach(node => {
                    opts.push({
                        filterable: (node.type?.name == 'ElTableColumn' || node.type?.name == 'ElTableColumnEditor') && node.props?.label != null,
                        visible: true,
                        label: node.props?.label,
                        node: node
                    });
                    node.patchFlag = 0;
                });
                this.columnOpts = opts;
                return this.columnOpts;
            }
        },
        render() {
            return Vue.h(() => {
                var nodes = [];
                this.columnOpts.forEach(opt => {
                    if (opt.visible) { nodes.push(opt.node); }
                });
                return nodes;
            });
        }
    };
</script>